package com.csi.service.impl;

import com.csi.mapper.SchedulingMapper;
import com.csi.service.SchedulingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SchedulingServiceImpl implements SchedulingService {

    @Autowired
    private SchedulingMapper schedulingMapper;
    @Override
    public List<String> findHotelStatus() {
        return schedulingMapper.findHotelStatus();
    }

    @Override
    public int deleteHotel(List<String> cancelHotelIds) {
        return schedulingMapper.deleteHotel(cancelHotelIds);
    }

    @Override
    public List<String> findFacilityStatus() {
        return schedulingMapper.findFacilityStatus();
    }

    @Override
    public int deleteFacility(List<String> cancelFacilityIds) {
        return schedulingMapper.deleteFacility(cancelFacilityIds);
    }

    @Override
    public List<String> findRoomTypeStatus() {
        return schedulingMapper.findRoomTypeStatus();
    }

    @Override
    public int deleteRoomType(List<String> cancelRoomTypeIds) {
        int deleted = schedulingMapper.deleteRoomType(cancelRoomTypeIds);
        for (String roomTypeId:cancelRoomTypeIds){
            int deleted1  = schedulingMapper.deleteRooms(roomTypeId);
            int deleted2 = schedulingMapper.deleteRoomFacilities(roomTypeId);
        }
        return deleted;
    }
}
